require("reset.css")
require("./ietest.scss");

!window["cdnPath"] && (window["cdnPath"] = './');
!window["urlPath"] && (window["urlPath"] = '//www.wan.com/huodong/ddt/20170221/');

declare var $: any;
declare var unescape: any;

 var $_ = require("jquery")
 window["$"] = $_;

// preload 图片预加载
$(`<img src="${require("./images/tag-1.png")}">`).load()
$(`<img src="${require("./images/tag-2.png")}">`).load()
$(`<img src="${require("./images/bg-nav.png")}">`).load()

//获取url中的参数
$.getQueryString = function (name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
    var r = window.location.search.substr(1).match(reg);
    if (r != null) return unescape(r[2]);
    return null;
}
$.page = $.getQueryString('page');

// 页面懒加载
require.ensure([], function () {
    require("./html/pageLeft.scss")
    $("#pageLeft").html(require("./html/pageLeft.html"))
})
require.ensure([], function () {
    $("#shareBox").html(require("./html/shareBox.html"))
})
require.ensure([], function () {
    require("./html/board.scss")
    $("#board").html(require("./html/board.html"))
})
